home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
MAC.TAS
< prev
next >
Wrap
Text File
|
1991-08-04
|
2KB
|
48 lines
#MAX_QUOTES 1000
{ MAC.TAS
This script will calculate the McClellan Oscillator
and the McClellan Summation indicators.
-----------------------------------------------------
To run this, you should have a ticker file containing
only NYAD and NYDE (or whatever symbols you use for
NYSE Advancing and NYSE Declining issues
-----------------------------------------------------
Calculate a McClellan Oscillator as follows
ADdiff = NYAD - NYDE;
MacOsc = MOV(ADdiff,19,'E')-MOV(ADdiff,39,'E')
Calculate a McClellan Summation as follows
MacSum = cum(MacOsc) + MacSumBase
where 'MacSumBase' is a starting value for the
McClellan Summation so that it is
"in sync" with someone else's value
}
#index 'sp-500'
#output_file mac.lst
NYADname = 'NYAD'; { Change to your NYSE Adv Issues ticker}
NYDEname = 'NYDE'; { Change to your NYSE Dec Issues ticker}
NYAD : ARRAY; { advancing issues}
NYDE : ARRAY; { declining issues}
ADdiff : ARRAY; { advancing - declining}
MacOsc : ARRAY; { McClellan Oscillator goes here}
MacSum : ARRAY; { McClellan Summation goes here}
MacSumBase = 522.15; { Set this to whatever starting value
you want to MacSum to start at}
MacBaseArray : ARRAY; { array of Base value}
if ticker = NYADname then
NYAD = C; { #issues in the CLOSE field}
if ticker = NYDEname then
NYDE = C; { #issues in the CLOSE field}
if last_ticker = 0 then return;
ADdiff = SUB(NYAD,NYDE); { Adv - Dec}
MacOsc = SUB(MOV(ADdiff,19,'E'),MOV(ADdiff,39,'E')); {19ema-39ema}
SET(MacBaseArray,MacSumBase); { set array to constant value}
MacSum = CUM(MacOsc); { compute cumulative value}
MacSum = ADD(MacSum,MacBaseArray); { add the base offset for macsum}
OPENGRAPH(3); { Start 3 graphs}
GRAPH(INDEX,'SP-500 Index');
GRAPH(MacOsc,'McClellan Oscillator');
GRAPH(MacSum,'McClellan Summation');
CLOSEGRAPH();
WRITELN('McClellan Oscillator for ',DATE,' is ',MacOsc);
WRITELN('McClellan Summation for ',DATE,' is ',MacSum);